package com.training;
class Common implements Inter1{
	public void name() {
		System.out.println("from Common name method");
	}
	public void age() {
		System.out.println("from Common name method");
	}
	public void call(){
		ThreadEx t1 = new ThreadEx(this);
		t1.associate();
	}
}
public class Commoncalling{
	public static void main(String args[]){
		Common c1 = new Common();
		c1.call();
	}
}

interface Inter1 {
//	public Inter1(){
//		
//	}
	public void name();
	public int age = 21;
	public void age();
}


class ThreadEx implements Inter1 {
public Object obj1;
	public ThreadEx(Object ass){
	this.obj1 = ass;
	}

	public void name() {
	System.out.println("from ThreadEx name method");		
	}
	public void associate(){
			((Inter1) obj1).name();
			((Inter1) obj1).age();
	}
	public void age() {
		System.out.println("from ThreadEx age method");		
	}
}